Skip to content

build: Ensure that Linux builds use Python 3.10 ABI#304

Merged
Oliver Borchert (borchero) merged 1 commit intoQuantco:mainfrom
gab23r:fix/linux-abi3-wheels
Mar 27, 2026
Merged

build: Ensure that Linux builds use Python 3.10 ABI#304
Oliver Borchert (borchero) merged 1 commit intoQuantco:mainfrom
gab23r:fix/linux-abi3-wheels

Conversation

@gab23r
Copy link
Copy Markdown
Contributor

@gab23r gab23r commented Mar 26, 2026

Summary

  • Fix Linux wheels being built as cp38-cp38 instead of cp310-abi3
  • Pass -i python3.10 to maturin for Linux builds to ensure abi3 wheels are produced
  • This allows Linux users to install without requiring Rust on the target system

Root Cause

The actions/setup-python action sets up Python 3.10 on the host runner, but this has no effect inside the manylinux Docker container used for Linux builds. The manylinux2014 container's default Python is 3.8, causing maturin to build non-abi3 wheels.

From the maturin-action README:

Note that the actions/setup-python action won't affect manylinux build since it's containerized, so if you want to build for certain Python version for Linux, use -i pythonX.Y in the args option

Test plan

  • CI builds pass
  • Verify Linux wheel artifacts are named cp310-abi3-manylinux* instead of cp38-cp38-manylinux*

Fixes #303


This PR was created with assistance from Claude Code (AI).

🤖 Generated with Claude Code

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (72fb1a6) to head (045fd44).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #304   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           56        56           
  Lines         3218      3218           
=========================================
  Hits          3218      3218           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the GitHub Actions build workflow to ensure Linux wheels are built as cp310-abi3 (matching the project’s requires-python >=3.10 / pyo3 abi3 configuration), so Linux users can install from wheels without needing Rust.

Changes:

  • Add -i python3.10 to maturin invocation for Linux wheel builds (x86_64 and aarch64).
  • Parameterize maturin arguments via the matrix to keep non-Linux builds unchanged.

@gab23r
Copy link
Copy Markdown
Contributor Author

gab23r commented Mar 27, 2026

On macOS and Windows, the build runs natively on the runner, so actions/setup-python successfully makes Python 3.10 available to maturin. Maturin then detects the abi3-py310 feature from Cargo.toml and builds abi3 wheels automatically.

On Linux with manylinux: auto, the build runs inside a Docker container. The actions/setup-python on the host has no effect inside the container, so maturin only sees the container's default Python (3.8), and falls back to non-abi3 wheels.

I've simplified the approach: now -i python3.10 is passed for all platforms, and the actions/setup-python step is removed entirely since it's no longer needed.

The Linux wheels were being built as cp38-cp38 instead of cp310-abi3
because the manylinux Docker container doesn't have access to the
Python 3.10 interpreter set up by actions/setup-python.

Pass `-i python3.10` to maturin for all builds and remove the now
unnecessary actions/setup-python step.

Fixes Quantco#303

---
This PR was created with assistance from Claude Code (AI).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gab23r gab23r force-pushed the fix/linux-abi3-wheels branch from 4bc36cd to 045fd44 Compare March 27, 2026 14:15
@borchero Oliver Borchert (borchero) changed the title fix: Build abi3 wheels for Linux build: Ensure that Linux builds use Python 3.10 ABI Mar 27, 2026
@github-actions github-actions bot added the build label Mar 27, 2026
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks good. Please don't copy-paste Claude answers in conversations here though 😅

@borchero Oliver Borchert (borchero) merged commit 217bd24 into Quantco:main Mar 27, 2026
34 checks passed
@gab23r
Copy link
Copy Markdown
Contributor Author

gab23r commented Mar 27, 2026

Yes sorry, i was trying more and more things recently with this tools and here I asked him to answer directly in the issue. A least I thought he will sign...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Request: Linux wheels for Python 3.10+

3 participants